<% num_showing = 0 %>
<% @stories.each_with_index do |story,i| %>
  <% next if story.id == @featured_story.id %>
  <% num_showing += 1 %>
  <% break if (num_showing == 3 && user_signed_in?) && @home_page %>
  <% if !user_signed_in? && i == 4 %>
    <div class="single-article single-article-small-pic feed-cta" id="in-feed-cta">
        <div class="cta-container" id="cta-content">
          <h2>
            <% if @tag.blank? %>
              Need more relevant posts?<br />Sign in to customize your feed:
            <% else %>
              <a href="/">dev.to</a> is a community of <br/><%= number_with_delimiter User.all.size %> amazing humans who code.
            <% end %>
          </h2>
          <div class="button-container">
            <a href="/users/auth/twitter?callback_url=<%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>/users/auth/twitter/callback" class="cta cta-button" data-no-instant>
              TWITTER
            </a>
            <a href="/users/auth/github?state=in-feed-cta" class="cta cta-button" data-no-instant>
              GITHUB
            </a>
          </div>
      </div>
    </div>
  <% end %>
  <%= render "articles/single_story", story: story %>
  <% if i == 0 && @comments && @comments.size > 0 && @user %>
    <%= render "articles/comments_section" %>
  <% end %>
<% end %>
<% if @stories.length == 0 && @comments && @comments.size > 0 && @user %>
  <%= render "articles/comments_section" %>
<% end %>
<% if @stories.size > 1 %>
  <div class="placeholder-div">
  </div>
<% end %>
<div class="single-article-small-pic" id="article-index-hidden-div" style="display:none"></div>